package top.mindse.office2pdf.component;

import cn.hutool.json.JSONUtil;
import org.springframework.stereotype.Component;
import top.mindse.office2pdf.aspect.LogRecord;
import top.mindse.office2pdf.entity.UserDemo;


@Component
public class MyComponent {

    @LogRecord(desc = "'修改了订单的配送员：从:{'+{#deveryUser(#request.name)}+'}, 修改到:{'+{#deveryUser(#request.getId())}+'}'")
    public UserDemo modifyUser(UserDemo request) {
        System.out.println(JSONUtil.toJsonStr(request));
        return request;
    }

    @LogRecord(desc = "'修改了订单的配送员：从:{'+{#deveryUser(#request.name)}+'}, 修改到:{'+{#deveryUser(#request.getId())}+'}'")
    public UserDemo modifyUser2(UserDemo request) {
        System.out.println(JSONUtil.toJsonStr(request));
        throw new RuntimeException("错误的参数");
    }
}
